home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / tex / tex31 / texsrc.lzh / TEXSRC.LZH / makefile < prev    next >
Encoding:
Makefile  |  1991-01-13  |  5.0 KB  |  209 lines

  1. # This file makes TeX in its various incarnations.
  2. #
  3. # The file ../common/texmf.h uses the symbol `TeX' to define certain
  4. # things that are different for TeX and Metafont, hence the addition to
  5. # CFLAGS.
  6.  
  7. SITEDIR=..
  8. CC=gcc
  9. PROF=#-pg
  10. OPT=-O -fstrength-reduce -fcombine-regs -fomit-frame-pointer $(PROF)
  11. CFLAGS=$(OPT) -I$(SITEDIR) -DTeX
  12. LDFLAGS=#-lcposix
  13. SHELL=/bin/sh
  14.  
  15. # The formats we know how to make.
  16. formats=amstex.fmt etex.fmt latex.fmt slitex.fmt tex.fmt \
  17. texinfo.fmt picplus.fmt
  18.  
  19.  
  20. makeargs=SITEDIR="$(SITEDIR)" CC="$(CC)" OPT="$(OPT)" LDFLAGS="$(LDFLAGS)"
  21.  
  22. .SUFFIXES:
  23. .SUFFIXES: .o .c
  24. .c.o:
  25.         $(CC) $(CFLAGS) -c $*.c
  26.  
  27. # Routines used everywhere.
  28. commondefines=../common/common.defines ../common/texmf.defines
  29. commonh=../common/extra.h
  30. commono=../common/extra.o
  31.  
  32. # Routines used in both TeX and Metafont.
  33. extrac=../common/texmf.c
  34. extrah=../common/texmf.h
  35. extrao=texmf.o
  36.  
  37. # Routines used in TeX, Metafont, and BibTeX.
  38. fileioc=../common/fileio.c
  39. fileioh=../common/fileio.h
  40. fileioo=fileio.o
  41.  
  42. # We don't add `$(commono)' here, since it doesn't depend on anything in
  43. # this directory, and we write a dependency for `$(objs)' below.
  44. objs=$(fileioo) tex0.o tex1.o tex2.o tex3.o tex4.o tex5.o tex6.o tex7.o tex8.o
  45. objs2=tex9.o tex10.o tex11.o tex12.o tex13.o tex14.o tex15.o tex16.o
  46. iobjs=iextra.o initex.o $(objs) $(objs2)
  47. vobjs=tex-extr.o itex.o $(objs) $(objs2)
  48.  
  49.  
  50. default:    all
  51.  
  52. all:        initex virtex
  53.         mv initex h:\tex\initex.ttp
  54.         mv virtex h:\tex\virtex.ttp
  55. triptrap:    triptex
  56.  
  57. initex:        $(iobjs) $(commono)
  58.         $(CC) $(PROF) -o initex $(iobjs) $(commono) $(LDFLAGS)
  59.  
  60. virtex:        $(vobjs) $(commono)
  61.         $(CC) $(PROF) -o virtex $(vobjs) $(commono) $(LDFLAGS)
  62.  
  63. run-trip:
  64.         rm -f trip.tex
  65.         -ln TeXtrip/trip.tex .
  66.         ../texware/pltotf TeXtrip/trip.pl trip.tfm
  67.         -$(SHELL) -c '. ./tripenv; \
  68.                   ./triptex < TeXtrip/trip1.in > /dev/null 2>&1'
  69.         -diff TeXtrip/tripin.log trip.log
  70.         -$(SHELL) -c '. ./tripenv; \
  71.                   ./triptex < TeXtrip/trip2.in > trip.fot'
  72.         -diff TeXtrip/trip.log trip.log
  73.         -diff TeXtrip/trip.fot trip.fot
  74.         $(SHELL) -c '. ./tripenv; \
  75.           ../texware/dvitype trip.dvi < TeXtrip/dvitype.in > trip.typ'
  76.         -diff TeXtrip/trip.typ trip.typ
  77.  
  78.  
  79. # Make format files automatically.
  80. fmts: $(formats)
  81.  
  82. amstex.fmt: tex.fmt
  83.     ./initex \&./tex amstex \\dump
  84.  
  85. etex.fmt: tex.fmt
  86.     ./initex \&./tex eplain \\dump
  87.     mv eplain.fmt etex.fmt
  88.     mv eplain.log etex.log
  89.  
  90. # Until LaTeX and SLiTeX are updated, we must use a hacked version, that
  91. # sets the new parameters to reasonable values.
  92. latex.fmt:
  93.     ./initex lplain3 \\dump
  94.     mv lplain3.fmt latex.fmt
  95.     mv lplain3.log latex.log
  96.  
  97. picplus.fmt: tex.fmt
  98.     ./initex \&./tex picplus \\dump
  99.  
  100. slitex.fmt:
  101.     ./initex splain3 \\dump
  102.     mv splain3.fmt slitex.fmt
  103.     mv splain3.log slitex.log
  104.  
  105. tex.fmt:
  106.     ./initex plain \\dump
  107.     mv plain.fmt tex.fmt
  108.     mv plain.log tex.log
  109.  
  110. # texinfo changes the escape character from `\' to `@'.
  111. texinfo.fmt: tex.fmt
  112.     ./initex \&./tex texinfo @dump
  113.  
  114.  
  115. # The `ini_to_trip' script changes texd.h, instead of the change file, so
  116. # retangling is not necessary.  After changing constants, making a
  117. # triptex means making an initex.
  118. triptex:    stamp-trip $(iobjs) $(commono)
  119.         make $(makeargs) initex
  120.         mv initex triptex
  121.  
  122. stamp-trip:    stamp-convert
  123.         rm -f *.o
  124.         $(SHELL) ./ini_to_trip texd.h
  125.         touch stamp-trip
  126.  
  127. # tangle produces tex.p and tex.pool.
  128. tex.p:        tex.web ctex.ch
  129.         ../web/tangle tex.web ctex.ch
  130.  
  131. # The convert script produces tex[0-8].c, itex.c, coerce.h, and texd.h.
  132. # The (hand-coded) memory.h is included in one of tex?.c files; it isn't
  133. # really necessary to `convert' again if it changes, only to recompile
  134. # those files, but describing that relationship is ugly to do.
  135. # (Furthermore, memory.h is stable.)
  136. stamp-convert:    tex.p memory.h fixcoerce.h $(commondefines)
  137.         $(SHELL) ./convert
  138.         touch stamp-convert
  139.  
  140. # The (hand-coded) file $(extrac) and the (generated) file itex.c have
  141. # #ifdefs for INITEX, so we compile them differently.
  142. iextra.o:    $(extrac) texd.h $(extrah) $(commonh)
  143.         $(CC) $(CFLAGS) -I. -DINITEX -DINI -c $(extrac)
  144.         mv $(extrao) iextra.o
  145.  
  146. initex.o:       itex.c texd.h $(extrah) $(commonh)
  147.         $(CC) $(CFLAGS) -DINITEX -c itex.c 
  148.         mv itex.o initex.o
  149.  
  150. $(objs):    texd.h
  151. tex-extr.o:    $(extrac) texd.h
  152.         $(CC) $(CFLAGS) -I. -c $(extrac)
  153.         mv $(extrao) tex-extr.o
  154.  
  155. $(fileioo):    $(fileioc) $(fileioh)
  156.         $(CC) $(CFLAGS) -I. -c $(fileioc)
  157.  
  158. tex0.o:        tex0.c
  159. tex1.o:        tex1.c
  160. tex2.o:        tex2.c
  161. tex3.o:        tex3.c
  162. tex4.o:        tex4.c
  163. tex5.o:        tex5.c
  164. tex60o:        tex6.c
  165. tex7.o:        tex7.c
  166. tex8.o:        tex8.c
  167. tex9.o:        tex9.c
  168. tex10.o:    tex10.c
  169. tex11.o:    tex11.c
  170. tex12.o:    tex12.c
  171. tex13.o:    tex13.c
  172. tex14.o:    tex14.c
  173. tex15.o:    tex15.c
  174. tex16.o:    tex16.c
  175.  
  176. clean:
  177.         rm -f stamp-* *.o triptex initex virtex *.lzh *.bak
  178.         rm -f texd.h coerce.h *.log *.fmt *.aux
  179.         rm -f 8terminal.tex trip.* tripos.tex dvitype.out
  180.  
  181. veryclean:    clean
  182.         rm -f tex?.c itex.c tex.p tex.pool texput.*
  183.         rm -f \#*\# *~ *.bak *.ckp core
  184.  
  185. lharc:
  186.         rm -f tex.lzh tex.bak
  187.         lharc a tex.lzh initex virtex tex.pool
  188.  
  189. lharc-obj:
  190.         rm -f texobj.lzh texobj.bak
  191.         lharc a texobj.lzh initex virtex tex.pool *.o
  192.  
  193. lharc-src:
  194.         rm -f texsrc.lzh texsrc.bak
  195.         lharc a texsrc.lzh *.c *.h Makefile
  196.